<?php

use think\migration\Migrator;
use think\migration\db\Column;

class BuFileLog extends Migrator
{
    public function change()
    {
        $table = $this->table('bu_file_log', ['auto_increment' => true, 'limit' => 10, 'signed' => false]);
        $table->addColumn('api_key', 'string', ['limit' => 100, 'default' => '', 'comment' => '外部接口api_key'])
            ->addColumn('file_path', 'string', ['limit' => 255, 'default' => '', 'comment' => '文件地址'])
            ->addColumn('file_status', 'integer', ['limit' => 255, 'default' => 1, 'signed' => false, 'comment' => '文件状态'])
            ->addColumn('file_time', 'string', ['limit' => 255, 'default' => '', 'signed' => false, 'comment' => '文件创建时间'])
            ->addColumn('is_temp', 'integer', ['limit' => 255, 'default' => 0, 'signed' => false, 'comment' => '是否是缓存；0-否；1-是'])
            ->addColumn('create_time', 'datetime', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '记录创建时间'])
            ->create();
    }
}
